-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSONRPC request-response logging #1236
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
|
we might want to delete enter traces to rpcs as well, I think there were some in ledger rpc, wdyt? |
Description
Added logging to each JSONRPC request and response to be able to have better debuggability of our nodes. Each request and successful response is logged with debug tracing level. Error responses are logged with warn level since it is highly likely that the error is caused by the client-side.
Original idea was to add a new tracing level for rpc request logging. But such behavior is not possible with tracing crate. Instead of that, errors are now logged to warn level, and can be searched with a filter such as level = WARN && message = rpc_error.
I initially logged the request and success responses to info level, but due to full nodes constantly spamming sequencer for new blocks through rpc, sequencer logs became full with useless rpc calls, which is not good. Another potential approach might be to make Sequencer RPC logs debug, but full node rpc logs info.
Also, prover doesn't have any rpc logs as it is unnecessary.
Linked Issues
Testing
I ran sequencer and full node and sent rpc requests and observed logs.